package exportimporterentities;

import java.util.ArrayList;

import api.entitites.IGarage;
import api.entitites.IMaster;
import api.entitites.IOrder;
import api.exportimportentities.IExportImportEntities;

public class ExportImportEntities implements IExportImportEntities{

	private Export exporter = new Export();
	private Import importer  = new Import();

	public void ExportGarages(ArrayList<IGarage> garList) {
		exporter.exportGarage(garList);
	}

	public void ExportMasters(ArrayList<IMaster>masList) {
		exporter.exportMaster(masList);
	}

	public void ExportOrders(ArrayList<IOrder> ordList) {
		exporter.exportOrder(ordList);
	}

	public void ImportGarages(ArrayList<IGarage> garList) {
		if(!garList.isEmpty()){
		garList.clear();
		}
		garList.addAll(importer.getGarages());
	}

	public void ImportMasters(ArrayList<IMaster>masList) {
		if(!masList.isEmpty()){
			masList.clear();
		}
		masList.addAll(importer.getMasters());
	}

	public void ImportOrders(ArrayList<IOrder> ordList) {
		if(!ordList.isEmpty()){
			ordList.clear();
		}
		ordList.addAll(importer.getOrders());
	}

}
